package cn.tedu.review;

/**
 * @author: Dsi
 * @date: 2021/11/9 10:08
 * @description:该类用于回顾继承
 */
public class TestExtends {
    public static void main(String[] args) {
        Animal a=new Animal();
        Cat c=new Cat();
        MM m=new MM();
        a.eat();
        c.eat();
        m.eat();
    }

}
class Animal{
    public void eat(){
        System.out.println("Animal的eat");
    }
}
class Cat extends Animal{
    int a=10;
    private int b = 100;

    public void play() {
        System.out.println(a);
        System.out.println(b);
    }
}
class MM extends Cat{
    public void play1(){
        System.out.println(a);
        //System.out.println(b);//私有继承但不可用
    }
}